<?php
class User_levelModel extends MongoModel{
	var $table = 'user_level';
    var $name = '用户级别';
	var $db_name = UCENTER_DB_NAME;
	
	public function find($attrs, $lang=null, $columns=null){
		$mls = parent::find($attrs, $columns);
		if(empty($mls))
			return null;
    	if($lang==null)$lang = LANGUAGE;
		foreach ($mls as $k=>&$ml){
    		if(isset($ml['name'][$lang])){
    			$ml['name'] = $ml['name'][$lang];
    		}
		}
		return $mls;
	}
	
	public function get_member_level_options($attrs, $lang=null){
		$mls = self::find($attrs, $lang, 'name.' . $lang . ',coin');
		$options = array();
		foreach($mls as $key=>$ml){
			$options[$key] = $ml['name'];
		}
		return $options;
	}
}

?>